package com.qingcheng.service;

import com.qingcheng.pojo.goods.Sku;
import com.qingcheng.pojo.order.OrderItem;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient("service-goods")
public interface SkuFegin {

    @GetMapping("/goods/sku/findById")
    Sku findById(@RequestParam("id") String id);

    @PostMapping("/goods/sku/deductionStock")
    boolean deductionStock(@RequestBody List<OrderItem> orderItemList);
}
